package com.ruoyi.exam.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.QuestionResultMapper;
import com.ruoyi.exam.domain.QuestionResult;
import com.ruoyi.exam.service.IQuestionResultService;

/**
 * 试题答案Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-01
 */
@Service
public class QuestionResultServiceImpl implements IQuestionResultService 
{
    @Autowired
    private QuestionResultMapper questionResultMapper;

    /**
     * 查询试题答案
     * 
     * @param id 试题答案主键
     * @return 试题答案
     */
    @Override
    public QuestionResult selectQuestionResultById(Long id)
    {
        return questionResultMapper.selectQuestionResultById(id);
    }

    /**
     * 查询试题答案列表
     * 
     * @param questionResult 试题答案
     * @return 试题答案
     */
    @Override
    public List<QuestionResult> selectQuestionResultList(QuestionResult questionResult)
    {
        return questionResultMapper.selectQuestionResultList(questionResult);
    }

    /**
     * 新增试题答案
     * 
     * @param questionResult 试题答案
     * @return 结果
     */
    @Override
    public int insertQuestionResult(QuestionResult questionResult)
    {
        questionResult.setCreateTime(DateUtils.getNowDate());
        return questionResultMapper.insertQuestionResult(questionResult);
    }

    /**
     * 修改试题答案
     * 
     * @param questionResult 试题答案
     * @return 结果
     */
    @Override
    public int updateQuestionResult(QuestionResult questionResult)
    {
        questionResult.setUpdateTime(DateUtils.getNowDate());
        return questionResultMapper.updateQuestionResult(questionResult);
    }

    /**
     * 批量删除试题答案
     * 
     * @param ids 需要删除的试题答案主键
     * @return 结果
     */
    @Override
    public int deleteQuestionResultByIds(Long[] ids)
    {
        return questionResultMapper.deleteQuestionResultByIds(ids);
    }

    /**
     * 删除试题答案信息
     * 
     * @param id 试题答案主键
     * @return 结果
     */
    @Override
    public int deleteQuestionResultById(Long id)
    {
        return questionResultMapper.deleteQuestionResultById(id);
    }
}
